{% extends 'base.html' %}
{% load static %}

{% block title %}删除文章 - {{ article.title }}{% endblock %}

{% block extra_css %}
<style>
    .delete-container {
        max-width: 600px;
        margin: 0 auto;
        padding: 40px 20px;
    }
    
    .delete-card {
        background: var(--card-bg);
        border-radius: 12px;
        padding: 40px;
        border: 1px solid var(--border-color);
        text-align: center;
    }
    
    .delete-icon {
        font-size: 4rem;
        color: #dc3545;
        margin-bottom: 20px;
    }
    
    .delete-title {
        color: var(--text-primary);
        margin-bottom: 15px;
        font-size: 1.5rem;
        font-weight: 600;
    }
    
    .delete-message {
        color: var(--text-secondary);
        margin-bottom: 30px;
        line-height: 1.6;
    }
    
    .article-info {
        background: var(--bg-secondary);
        border-radius: 8px;
        padding: 20px;
        margin: 20px 0;
        text-align: left;
    }
    
    .article-info h4 {
        color: var(--text-primary);
        margin-bottom: 10px;
        font-size: 1.1rem;
    }
    
    .article-meta {
        color: var(--text-secondary);
        font-size: 0.9rem;
    }
    
    .btn-group {
        display: flex;
        gap: 15px;
        justify-content: center;
        margin-top: 30px;
    }
    
    .btn {
        padding: 12px 25px;
        border: none;
        border-radius: 8px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        display: inline-block;
    }
    
    .btn-danger {
        background: linear-gradient(135deg, #dc3545, #c82333);
        color: white;
    }
    
    .btn-danger:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
    }
    
    .btn-secondary {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    
    .btn-secondary:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        text-decoration: none;
    }
    
    .warning-text {
        color: #dc3545;
        font-weight: 500;
        margin-top: 15px;
    }
</style>
{% endblock %}

{% block content %}
<div class="container">
    <div class="delete-container">
        <div class="delete-card">
            <div class="delete-icon">
                <i class="fas fa-exclamation-triangle"></i>
            </div>
            
            <h2 class="delete-title">确认删除文章</h2>
            
            <p class="delete-message">
                您确定要删除这篇文章吗？此操作不可撤销，文章的所有内容和评论都将被永久删除。
            </p>
            
            <div class="article-info">
                <h4>{{ article.title }}</h4>
                <div class="article-meta">
                    <i class="fas fa-user me-2"></i>作者：{{ article.author.username }}
                    <br>
                    <i class="fas fa-calendar me-2"></i>创建时间：{{ article.created_at|date:"Y年m月d日 H:i" }}
                    <br>
                    <i class="fas fa-eye me-2"></i>浏览次数：{{ article.views }}
                </div>
            </div>
            
            <p class="warning-text">
                <i class="fas fa-exclamation-circle me-2"></i>
                警告：删除后无法恢复！
            </p>
            
            <form method="post" class="d-inline">
                {% csrf_token %}
                <div class="btn-group">
                    <a href="{% url 'blog:article_detail' slug=article.slug %}" class="btn btn-secondary">
                        <i class="fas fa-arrow-left me-2"></i>取消
                    </a>
                    <button type="submit" class="btn btn-danger">
                        <i class="fas fa-trash me-2"></i>确认删除
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}

{% block extra_js %}
<script>
    // 添加删除确认
    document.querySelector('form').addEventListener('submit', function(e) {
        if (!confirm('您确定要删除这篇文章吗？此操作不可撤销！')) {
            e.preventDefault();
        }
    });
</script>
{% endblock %}